package com.example.zzhxiangmu.view.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter
import com.example.zzhxiangmu.R
import com.example.zzhxiangmu.base.BaseActivity
import com.example.zzhxiangmu.databinding.ActivityYemianBinding
import com.example.zzhxiangmu.view.fragment.Fragmenter
import com.example.zzhxiangmu.view.fragment.Fragmentyi
import com.example.zzhxiangmu.viewmodel.Yemianviewmodel
import com.google.android.material.tabs.TabLayout

class Yemian : BaseActivity<Yemianviewmodel,ActivityYemianBinding>(R.layout.activity_yemian) {

    val fralirts= mutableListOf<Fragment>(Fragmentyi(),Fragmenter())
    val listrt= mutableListOf<String>("直播","关注")
    var isis2=false
    override fun initView() {

        binding.yemian.adapter=object : FragmentPagerAdapter(supportFragmentManager){
            override fun getCount(): Int {

                return fralirts.size

            }

            override fun getItem(position: Int): Fragment {

                return fralirts[position]

            }

            override fun getPageTitle(position: Int): CharSequence? {
                return listrt[position]


            }


        }

        binding.dibu.setupWithViewPager(binding.yemian)


        binding.dibu.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
            override fun onTabSelected(tab: TabLayout.Tab) {


            }

            override fun onTabUnselected(tab: TabLayout.Tab?) {

            }

            override fun onTabReselected(tab: TabLayout.Tab?) {

            }


        })









    }

    override fun dataObdwarr() {

    }

}